<!DOCTYPE HTML>
<html>
<head>
    <title><%= __('views.myKlkl')%></title>
    <% include common/meta.ejs %>
    <% include common/public.ejs %>
    <style>
        .imgRadius img {
            width: 100%;
            height: 100%;
            display: block;
            border-radius: 50%;
        }
        .m-list-name {
            font-size: 0.75rem;
            color: #4b4b4b;
        }
        .weui_cells:before{
            border-top: 0;
        }
        .weui_cell_ft{
            font-size: 0.7rem;
        }
    </style>
</head>
<body>

<div class="weui_tab">
    <div class="weui_tab_bd">

        <div class="weui_cells weui_cells_access" style="margin-top:0;">
            <a class="weui_cell" href="javascript:;">
                <div class="weui_cell_hd">
                    <img style="width: 4rem;border-radius: 20px;margin-right: 1rem;" src="<%= userData.headimgurl %>"
                         alt=""></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <p name="username"><%= userData.name || userData.nickname %></p>
                    <p style="color: #777777;"><%= userData.mobile %></p>
                    <p style="color: #666666;font-size: 80%;"><%= userData.job %></p>
                </div>
            </a>
        </div>

        <div class="weui_panel weui_panel_access">
            <div class="weui_panel_bd" style="text-align: center;">
                <div class="weui-row" style="padding: 0.5rem 0;">
                    <a href="myDianZ?openId=<%= session.openId %>" class="weui-col-33">
                        <p><%= __('views.myStore')%></p>
                        <p class="x-fs-080"><%= data.balanceAmount %></p>
                    </a>
                    <a href="mySheBei?openId=<%= session.openId %>" class="weui-col-33">
                        <p><%= __('views.myEquipment')%></p>
                        <p class="x-fs-080"><%= data.bonus %></p>
                    </a>
                    <a href="repairList?openId=<%= session.openId %>" class="weui-col-33">
                        <p><%= __('views.studyHistory')%></p>
                        <p class="x-fs-080"><%= data.billQuantity %></p>
                    </a>
                </div>
            </div>
        </div>


        <div class="weui_cells weui_cells_access">
            <a class="weui_cell" href="repairCall">
                <div class="weui_cell_hd">
                    <i class="fa fa-cog"></i>
                </div>
                <div class="weui_cell_bd weui_cell_primary m-list-name">
                    <p><%= __('views.equipmentRepair')%></p>
                </div>
                <div class="weui_cell_ft"></div>
            </a>
            <a class="weui_cell" href="javascript:void(0); " id="unLockAccount">
                <div class="weui_cell_hd">
                    <i class="fa fa-unlock"></i>
                </div>
                <div class="weui_cell_bd weui_cell_primary m-list-name">
                    <p><%= __('views.unbind')%></p>
                </div>
                <div class="weui_cell_ft"></div>
            </a>
            <a class="weui_cell" href="newsDetail?id=86195b34dfb64ec7a34c7039325bd98f">
                <div class="weui_cell_hd">
                    <i class="fa fa-bullhorn"></i>
                </div>
                <div class="weui_cell_bd weui_cell_primary m-list-name">
                    <p><%= __('views.systemDescription')%></p>
                </div>
                <div class="weui_cell_ft"></div>
            </a>
        </div>

    </div>
    <div class="weui_tabbar">
        <a href="index" class="weui_tabbar_item">
            <div class="weui_tabbar_icon">
                <img src="<%= global.config.publicPath %>/page/images/icon_nav_toast.png" alt="">
            </div>
            <p class="weui_tabbar_label"><%= __('homepage.homepage')%></p>
        </a>
        <a href="news" class="weui_tabbar_item">
            <div class="weui_tabbar_icon">
                <img src="<%= global.config.publicPath %>/page/images/icon_nav_button.png" alt="">
            </div>
            <p class="weui_tabbar_label"><%= __('news.news')%></p>
        </a>
        <a href="account" class="weui_tabbar_item weui_bar_item_on">
            <div class="weui_tabbar_icon">
                <img src="<%= global.config.publicPath %>/page/images/icon_nav_user.png" alt="">
            </div>
            <p class="weui_tabbar_label"><%= __('me.me')%></p>
        </a>
    </div>
</div>
<% include common/footer.ejs %>
<script>
    "use strict";
    $(function () {
       $("#unLockAccount").click(function () {
           $.confirm({
               title: Dolphin.i18n.get("views.confirmRelieve"),
               text: Dolphin.i18n.get("views.confirmAccount"),
               onOK: function () {
                   $.showLoading();
                   let data = {code:'<%= userData.code %>',wechat:'-1'};
                   console.log(data);
                   Dolphin.ajax({
                       url: '<%= global.config.contextPath == '/' ? '' : global.config.contextPath %>/api/dc8f406dd87c4942ad1c68240aa590c8',
                       type: Dolphin.requestMethod.POST,
                       data: Dolphin.json2string(data),
                       forceUrl: true,
                       onSuccess: function (reData) {
                           Dolphin.ajax({
                               url: '<%= global.config.contextPath == '/' ? '' : global.config.contextPath %>/refresh/session',
                               type: Dolphin.requestMethod.GET,
                               forceUrl: true,
                               onSuccess: function (reData) {
                                   location.href='index';
                               }
                           });
                       },
                       onComplete: function () {
                           $.hideLoading();
                       }
                   });
               },
               onCancel: function () {
               }
           });
       }); 
    });
</script>
</body>
</html>